﻿'
' DKP for DotNetNuke® - http://dkpdnn.codeplex.com
' Copyright (c) 2008
' by Casey Lengacher ( http://dkpdnn.codeplex.com )
'
' DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation.
'
' Permission is hereby granted, free of charge, to any person obtaining a copy
' of this software and associated documentation files (the "Software"), to deal
' in the Software without restriction, including without limitation the rights
' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
' copies of the Software, and to permit persons to whom the Software is
' furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in
' all copies or substantial portions of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
' SOFTWARE.
'

Imports DotNetNuke.Common.Utilities

Namespace DotNetNuke.Modules.tss_DKP

    Partial Public Class tss_ucLoots

        Inherits Entities.Modules.PortalModuleBase

#Region "Private Variables"

        Private Enum PageState As Integer
            NotSet = -1
            View = 0
            Add = 1
            SingleUpdate = 2
            MultiUpdate = 3
        End Enum

        Private Enum LootSystems As Integer
            Standard = 1
            Percent = 2
            SuicideKings = 3
        End Enum

#End Region

#Region "Private Properties"

        Private Property vsPageSize() As Integer
            Get
                If ViewState("tss_LootPageSize") Is Nothing Then
                    If (Request.Cookies.Get("tss_LootPageSize") Is Nothing) Then
                        Return ddlPageSize.Items(0).Value
                    Else
                        Return CInt(Request.Cookies.Get("tss_LootPageSize").Value)
                    End If
                Else
                    Return CInt(ViewState("tss_LootPageSize"))
                End If
            End Get
            Set(ByVal Value As Integer)
                ViewState("tss_LootPageSize") = Value
                Response.Cookies("tss_LootPageSize").Expires = DateTime.Now.AddYears(10)
                Response.Cookies("tss_LootPageSize").Value = Value
            End Set
        End Property

        Private Property vsSortExpression() As String
            Get
                If ViewState("tss_LootSortExpression") Is Nothing Then
                    If (Request.Cookies.Get("tss_LootSortExpression") Is Nothing) Then
                        Return "PlayerName"
                    Else
                        Return CInt(Request.Cookies.Get("tss_LootSortExpression").Value)
                    End If
                Else
                    Return CStr(ViewState("tss_LootSortExpression"))
                End If
            End Get
            Set(ByVal Value As String)
                ViewState("tss_LootSortExpression") = Value
                Response.Cookies("tss_LootSortExpression").Expires = DateTime.Now.AddYears(10)
                Response.Cookies("tss_LootSortExpression").Value = Value
            End Set
        End Property

        Private Property vsSortDirection() As String
            Get
                If ViewState("tss_LootSortDirection") Is Nothing Then
                    If (Request.Cookies.Get("tss_LootSortDirection") Is Nothing) Then
                        Return "ASC"
                    Else
                        Return CStr(Request.Cookies.Get("tss_LootSortDirection").Value)
                    End If
                Else
                    Return CStr(ViewState("tss_LootSortDirection"))
                End If
            End Get
            Set(ByVal Value As String)
                ViewState("tss_LootSortDirection") = Value
                Response.Cookies("tss_LootSortDirection").Expires = DateTime.Now.AddYears(10)
                Response.Cookies("tss_LootSortDirection").Value = Value
            End Set
        End Property

        Private Property vsCurrentPage() As Integer
            Get
                If ViewState("tss_LootCurrentPage") Is Nothing Then
                    Return 1
                Else
                    Return CInt(ViewState("tss_LootCurrentPage"))
                End If
            End Get
            Set(ByVal Value As Integer)
                ViewState("tss_LootCurrentPage") = Value
            End Set
        End Property

        Private Property vsTotalPages() As Integer
            Get
                If ViewState("tss_LootTotalPages") Is Nothing Then
                    Return 1
                Else
                    Return CInt(ViewState("tss_LootTotalPages"))
                End If
            End Get
            Set(ByVal Value As Integer)
                ViewState("tss_LootTotalPages") = Value
            End Set
        End Property

        Private Property vsPageState() As PageState
            Get
                If ViewState("tss_LootPageState") Is Nothing Then
                    Return PageState.NotSet
                Else
                    Return CStr(ViewState("tss_LootPageState"))
                End If
            End Get
            Set(ByVal Value As PageState)
                ViewState("tss_LootPageState") = Value
            End Set
        End Property

        Private Property vsRaidID() As Integer
            Get
                If ViewState("tss_RaidID") Is Nothing Then
                    Return Null.NullInteger
                Else
                    Return CInt(ViewState("tss_RaidID"))
                End If
            End Get
            Set(ByVal Value As Integer)
                ViewState("tss_RaidID") = Value
            End Set
        End Property

#End Region

#Region "Private Methods"

        Private Sub BindPage()

            Dim tss_DKP As New tss_DataController
            Dim intRowsAffected As Integer
            Dim intPageNumber As Integer = vsCurrentPage
            Dim intRaidID As Integer = vsRaidID
            Dim dblPagesAffected As Double = 1

            ddlPageSize.SelectedValue = ddlPageSize.Items.FindByText(vsPageSize).Value

            grdLoots.PageSize = vsPageSize

            For Each currentColumn As DataGridColumn In grdLoots.Columns
                currentColumn.HeaderText = currentColumn.HeaderText.Substring(0, _
                    IIf(currentColumn.HeaderText.IndexOf(" <img") > 0, currentColumn.HeaderText.IndexOf(" <img"), currentColumn.HeaderText.Length))
                If (currentColumn.SortExpression = vsSortExpression) Then
                    If (vsSortDirection = "ASC") Then
                        currentColumn.HeaderText = currentColumn.HeaderText _
                            + " <img src='/DesktopModules/tss_DKP/Images/grid_icon_uparrow.png' border=0 height=10 width=10>"
                    Else
                        currentColumn.HeaderText = currentColumn.HeaderText _
                            + " <img src='/DesktopModules/tss_DKP/Images/grid_icon_downarrow.png' border=0 height=10 width=10>"
                    End If
                End If
            Next

            grdLoots.DataSource = tss_DKP.tss_GetLootsByPage(intRaidID, intPageNumber, grdLoots.PageSize, vsSortExpression, vsSortDirection, intRowsAffected)
            grdLoots.DataBind()

            If (grdLoots.Items.Count = 0) And (intPageNumber > 1) Then
                intPageNumber = intPageNumber - 1
                vsCurrentPage = intPageNumber.ToString()
                grdLoots.DataSource = tss_DKP.tss_GetLootsByPage(intRaidID, intPageNumber, grdLoots.PageSize, vsSortExpression, vsSortDirection, intRowsAffected)
                grdLoots.DataBind()
            End If

            dblPagesAffected = System.Math.Ceiling(intRowsAffected / grdLoots.PageSize)
            If (dblPagesAffected < 1) Then
                dblPagesAffected = 1
            End If
            vsTotalPages = dblPagesAffected.ToString()
            lblCurrentPage.Text = vsCurrentPage
            lblTotalPages.Text = vsTotalPages

            If (intPageNumber = 1) Then
                lnkPreviousPage.Enabled = False

                If (dblPagesAffected > 1) Then
                    lnkNextPage.Enabled = True
                    lnkLastPage.Enabled = True
                Else
                    lnkNextPage.Enabled = False
                    lnkLastPage.Enabled = False
                End If
            Else
                lnkPreviousPage.Enabled = True

                If (intPageNumber = dblPagesAffected) Then
                    lnkNextPage.Enabled = False
                    lnkLastPage.Enabled = False
                Else
                    lnkNextPage.Enabled = True
                    lnkLastPage.Enabled = True
                End If
            End If

            If (DotNetNuke.Security.PortalSecurity.IsInRoles(Me.ModuleConfiguration.AuthorizedEditRoles)) And Not (UserId = -1) Then
                pnlEditPanel.Visible = True
                grdLoots.Columns(0).Visible = True
            Else
                pnlEditPanel.Visible = False
                grdLoots.Columns(0).Visible = False
            End If

        End Sub

        Private Sub ManagePageState(ByVal PageState As PageState)

            Dim tss_DKP As New tss_DataController

            vsPageState = PageState

            If (PageState = PageState.View) Then
                grdLoots.Enabled = True
                BindPage()
            Else
                grdLoots.Enabled = False
            End If

            If (PageState = PageState.View) Then
                pnlEditPanelForm.Visible = False
            Else

                Dim objBoard As tss_BoardInfo = tss_DKP.tss_GetBoard(CInt(Settings("BoardID")))
                Dim objRaid As tss_RaidInfo = tss_DKP.tss_GetRaid(vsRaidID)

                If (objBoard.SystemID = LootSystems.Standard) Then
                    ddlPlayerID.AutoPostBack = False
                Else
                    ddlPlayerID.AutoPostBack = True
                End If

                ddlPlayerID.DataTextField = "PlayerName"
                ddlPlayerID.DataValueField = "PlayerID"
                ddlPlayerID.DataSource = tss_DKP.tss_GetPlayersByRaid(vsRaidID)
                ddlPlayerID.DataBind()

                ddlDropID.AutoPostBack = True
                ddlDropID.DataTextField = "ItemName"
                ddlDropID.DataValueField = "DropID"
                ddlDropID.DataSource = tss_DKP.tss_GetDrops(objRaid.MobID)
                ddlDropID.DataBind()

                pnlEditPanelForm.Visible = True

            End If

            ddlPlayerID.ClearSelection()
            ddlDropID.ClearSelection()
            txtLootValue.Text = Null.NullString

            lblWarning.Text = Null.NullString

            If (PageState = PageState.Add) Then

                pnlPlayerID.Visible = True
                pnlDropID.Visible = True

                If (ddlPlayerID.Items.Count > 0) Then
                    ddlPlayerID.Items(0).Selected = True
                End If

                If (ddlDropID.Items.Count > 0) Then
                    ddlDropID.Items(0).Selected = True
                End If

                If (ddlPlayerID.Items.Count > 0) Or (ddlDropID.Items.Count > 0) Then
                    BindTextBoxes()
                End If

                ddlPlayerID.Focus()

            ElseIf (PageState = PageState.SingleUpdate) Then

                pnlPlayerID.Visible = True
                pnlDropID.Visible = True

                ddlPlayerID.Focus()

            ElseIf (PageState = PageState.MultiUpdate) Then

                pnlPlayerID.Visible = False
                pnlDropID.Visible = False

                txtLootValue.Focus()

            End If

        End Sub

        Private Sub BindTextBoxes()

            Dim tss_DKP As New tss_DataController
            Dim objBoard As tss_BoardInfo = tss_DKP.tss_GetBoard(CInt(Settings("BoardID")))
            Dim objPlayer As tss_PlayerInfo = tss_DKP.tss_GetPlayer(ddlPlayerID.SelectedValue)
            Dim objDrop As tss_DropInfo = tss_DKP.tss_GetDrop(ddlDropID.SelectedValue)
            Dim objItem As tss_ItemInfo = tss_DKP.tss_GetItem(objDrop.ItemID)

            If (objBoard.SystemID = LootSystems.Standard) Then

                txtLootValue.Text = objItem.ItemValue

            ElseIf (objBoard.SystemID = LootSystems.Percent) Then

                txtLootValue.Text = objItem.ItemPercent / 100 * objPlayer.SavedDKP

            ElseIf (objBoard.SystemID = LootSystems.SuicideKings) Then

                txtLootValue.Text = objPlayer.SavedDKP

            End If

        End Sub

#End Region

#Region "Private Event Handlers"

        Private Sub ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles grdLoots.ItemDataBound

            If (e.Item.ItemType.Equals(ListItemType.Item)) Or (e.Item.ItemType.Equals(ListItemType.AlternatingItem)) Then

                Dim lblLootID As Label = e.Item.FindControl("lblLootID")
                Dim lblLootValue As Label = e.Item.FindControl("lblLootValue")
                Dim lblPlayerName As Label = e.Item.FindControl("lblPlayerName")
                Dim lnkItemWowHeadID As HyperLink = e.Item.FindControl("lnkItemWowHeadID")
                Dim lblItemName As Label = e.Item.FindControl("lblItemName")

                Dim objLoot As tss_LootInfo = e.Item.DataItem

                lblLootID.Text = objLoot.LootID.ToString()
                lblLootID.Visible = False

                lblLootValue.Text = objLoot.LootValue
                lblPlayerName.Text = objLoot.PlayerName

                If (objLoot.ItemWowHeadID.Length = 0) Then
                    lnkItemWowHeadID.ImageUrl = "/DesktopModules/tss_DKP/Images/grid_icon_blank.png"
                    lnkItemWowHeadID.Enabled = False
                Else
                    lnkItemWowHeadID.ImageUrl = "/DesktopModules/tss_DKP/Images/grid_icon_wowhead.png"
                    lnkItemWowHeadID.NavigateUrl = "http://www.wowhead.com/?item=" + objLoot.ItemWowHeadID
                    lnkItemWowHeadID.Target = "_new"
                    lnkItemWowHeadID.Enabled = True
                    lnkItemWowHeadID.ToolTip = "View WowHead"
                End If

                lblItemName.Text = objLoot.ItemName

            End If

        End Sub

        Private Sub ItemCreated(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles grdLoots.ItemCreated

            If (e.Item.ItemType.Equals(ListItemType.Header)) Then

                For Each currentCell As TableCell In e.Item.Cells
                    currentCell.Attributes.Add("class", "dkpdnn_GridHeader" + grdLoots.Columns(e.Item.Cells.GetCellIndex(currentCell)).FooterText)
                Next

            ElseIf (e.Item.ItemType.Equals(ListItemType.Item)) Then

                e.Item.Attributes.Add("class", "dkpdnn_GridItem")
                e.Item.Attributes.Add("onmouseover", "className='dkpdnn_GridItemMouseOver';")
                e.Item.Attributes.Add("onmouseout", "className='dkpdnn_GridItem';")

                For Each currentCell As TableCell In e.Item.Cells
                    currentCell.Attributes.Add("class", "dkpdnn_GridItem" + grdLoots.Columns(e.Item.Cells.GetCellIndex(currentCell)).FooterText)
                Next

            ElseIf (e.Item.ItemType.Equals(ListItemType.AlternatingItem)) Then

                e.Item.Attributes.Add("class", "dkpdnn_GridAltItem")
                e.Item.Attributes.Add("onmouseover", "className='dkpdnn_GridAltItemMouseOver';")
                e.Item.Attributes.Add("onmouseout", "className='dkpdnn_GridAltItem';")

                For Each currentCell As TableCell In e.Item.Cells
                    currentCell.Attributes.Add("class", "dkpdnn_GridAltItem" + grdLoots.Columns(e.Item.Cells.GetCellIndex(currentCell)).FooterText)
                Next

            ElseIf (e.Item.ItemType.Equals(ListItemType.Footer)) Then

                e.Item.Visible = False

            End If

        End Sub

        Private Sub SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ddlPageSize.SelectedIndexChanged, ddlPlayerID.SelectedIndexChanged, ddlDropID.SelectedIndexChanged

            If (sender.Equals(ddlPageSize)) Then

                vsPageSize = ddlPageSize.SelectedValue
                ManagePageState(PageState.View)

            ElseIf (sender.Equals(ddlPlayerID)) Or (sender.Equals(ddlDropID)) Then

                BindTextBoxes()

            End If

        End Sub

        Private Sub SortCommand(ByVal sender As Object, ByVal e As DataGridSortCommandEventArgs) Handles grdLoots.SortCommand

            If (vsSortExpression = e.SortExpression) Then
                If (vsSortDirection = "ASC") Then
                    vsSortDirection = "DESC"
                ElseIf (vsSortDirection = "DESC") Then
                    vsSortDirection = "ASC"
                End If
            Else
                vsSortExpression = e.SortExpression
                vsSortDirection = "ASC"
            End If

            ManagePageState(PageState.View)

        End Sub

        Private Sub Click(ByVal sender As Object, ByVal e As EventArgs) Handles lnkFirstPage.Click, lnkPreviousPage.Click, lnkNextPage.Click, _
            lnkLastPage.Click, lnkAdd.Click, lnkUpdate.Click, lnkDelete.Click, lnkSubmit.Click, lnkCancel.Click, lnkReturnToRaids.Click

            Dim tss_DKP As New tss_DataController
            Dim tss_DKP_Parent As tss_DKP = Me.Parent.Parent

            lblWarning.Text = Null.NullString

            If (sender.Equals(lnkFirstPage)) Then

                vsCurrentPage = 1
                ManagePageState(PageState.View)

            ElseIf (sender.Equals(lnkPreviousPage)) Then

                vsCurrentPage = CInt(vsCurrentPage) - 1
                ManagePageState(PageState.View)

            ElseIf (sender.Equals(lnkNextPage)) Then

                vsCurrentPage = CInt(vsCurrentPage) + 1
                ManagePageState(PageState.View)

            ElseIf (sender.Equals(lnkLastPage)) Then

                vsCurrentPage = vsTotalPages
                ManagePageState(PageState.View)

            ElseIf (sender.Equals(lnkAdd)) Then

                ManagePageState(PageState.Add)

            ElseIf (sender.Equals(lnkUpdate)) Then

                Dim boolIsChecked As Boolean = False

                For Each currentLoot As DataGridItem In grdLoots.Items

                    If (currentLoot.ItemType.Equals(ListItemType.Item)) Or (currentLoot.ItemType.Equals(ListItemType.AlternatingItem)) Then

                        Dim chkLoot As CheckBox = currentLoot.FindControl("chkLoot")
                        Dim lblLootID As Label = currentLoot.FindControl("lblLootID")

                        If (chkLoot.Checked) And (boolIsChecked) Then

                            ManagePageState(PageState.MultiUpdate)
                            Exit For

                        ElseIf (chkLoot.Checked) And Not (boolIsChecked) Then

                            boolIsChecked = True

                            ManagePageState(PageState.SingleUpdate)

                            Dim objExistingLoot As tss_LootInfo = tss_DKP.tss_GetLoot(CInt(lblLootID.Text))

                            If (objExistingLoot Is Nothing) Then
                                ManagePageState(PageState.View)
                                lblWarning.Text = "Error: Loot in selection not found."
                                Exit For
                            Else
                                txtLootValue.Text = objExistingLoot.LootValue
                                ddlPlayerID.SelectedValue = objExistingLoot.PlayerID
                                ddlDropID.SelectedValue = objExistingLoot.DropID
                            End If

                        End If

                    End If

                Next

                If Not (boolIsChecked) Then
                    ManagePageState(PageState.View)
                End If

            ElseIf (sender.Equals(lnkDelete)) Then

                For Each currentLoot As DataGridItem In grdLoots.Items

                    If (currentLoot.ItemType.Equals(ListItemType.Item)) Or (currentLoot.ItemType.Equals(ListItemType.AlternatingItem)) Then

                        Dim chkLoot As CheckBox = currentLoot.FindControl("chkLoot")
                        Dim lblLootID As Label = currentLoot.FindControl("lblLootID")

                        If (chkLoot.Checked) Then
                            tss_DKP.tss_DeleteLoot(CInt(lblLootID.Text))
                        End If

                    End If

                Next

                ManagePageState(PageState.View)

            ElseIf (sender.Equals(lnkSubmit)) Then

                If (vsPageState = PageState.Add) Then

                    If (txtLootValue.Text.Trim.Length = 0) Then
                        lblWarning.Text = "Error: Loot value can not be empty."
                    ElseIf (ddlPlayerID.SelectedValue.Length = 0) Then
                        lblWarning.Text = "Error: Player name can not be empty."
                    ElseIf (ddlDropID.SelectedValue.Length = 0) Then
                        lblWarning.Text = "Error: Drop name can not be empty."
                    Else

                        Dim objNewLoot As New tss_LootInfo : objNewLoot = CBO.InitializeObject(objNewLoot, GetType(tss_LootInfo))

                        objNewLoot.LootValue = txtLootValue.Text.Trim
                        objNewLoot.RaidID = vsRaidID
                        objNewLoot.PlayerID = ddlPlayerID.SelectedValue
                        objNewLoot.DropID = ddlDropID.SelectedValue

                        Try
                            tss_DKP.tss_AddLoot(objNewLoot)
                        Catch ex As ApplicationException
                            lblWarning.Text = "Error: Trying to add loot resulted in the following error (" + ex.Message + ")."
                        End Try

                    End If

                    If (lblWarning.Text.Length = 0) Then
                        ManagePageState(PageState.View)
                    End If

                ElseIf (vsPageState = PageState.SingleUpdate) Then

                    For Each currentLoot As DataGridItem In grdLoots.Items

                        If (currentLoot.ItemType.Equals(ListItemType.Item)) Or (currentLoot.ItemType.Equals(ListItemType.AlternatingItem)) Then

                            Dim chkLoot As CheckBox = currentLoot.FindControl("chkLoot")
                            Dim lblLootID As Label = currentLoot.FindControl("lblLootID")

                            If (chkLoot.Checked) Then

                                Dim objExistingLoot As tss_LootInfo = tss_DKP.tss_GetLoot(CInt(lblLootID.Text))

                                If (objExistingLoot Is Nothing) Then
                                    lblWarning.Text = "Error: Trying to update loot resulted in the following error (Loot in selection not found.)."
                                Else

                                    objExistingLoot.LootValue = txtLootValue.Text.Trim
                                    objExistingLoot.PlayerID = ddlPlayerID.SelectedValue
                                    objExistingLoot.DropID = ddlDropID.SelectedValue

                                    Try
                                        tss_DKP.tss_UpdateLoot(objExistingLoot)
                                    Catch ex As ApplicationException
                                        lblWarning.Text = "Error: Trying to update loot resulted in the following error (" + ex.Message + ")."
                                    End Try

                                End If

                            End If

                        End If

                    Next

                    If (lblWarning.Text = Null.NullString) Then
                        ManagePageState(PageState.View)
                    End If

                ElseIf (vsPageState = PageState.MultiUpdate) Then

                    Dim boolIsChecked As Boolean = False

                    For Each currentLoot As DataGridItem In grdLoots.Items

                        If (currentLoot.ItemType.Equals(ListItemType.Item)) Or (currentLoot.ItemType.Equals(ListItemType.AlternatingItem)) Then

                            Dim chkLoot As CheckBox = currentLoot.FindControl("chkLoot")
                            Dim lblLootID As Label = currentLoot.FindControl("lblLootID")

                            If (chkLoot.Checked) Then

                                Dim objExistingLoot As tss_LootInfo = tss_DKP.tss_GetLoot(CInt(lblLootID.Text))

                                If (objExistingLoot Is Nothing) Then
                                    lblWarning.Text = lblWarning.Text + IIf(lblWarning.Text.Length > 0, "<br>", "") _
                                        + "Error: Trying to update loot resulted in the following error (Loot in selection not found.)."
                                Else

                                    objExistingLoot.LootValue = txtLootValue.Text.Trim

                                    Try
                                        tss_DKP.tss_UpdateLoot(objExistingLoot)
                                    Catch ex As ApplicationException
                                        lblWarning.Text = lblWarning.Text + IIf(lblWarning.Text.Length > 0, "<br>", "") _
                                            + "Error: Trying to update loot (" + objExistingLoot.ItemName _
                                            + ") for player (" + objExistingLoot.PlayerName + ") resulted in the following error (" + ex.Message + ")."
                                    End Try

                                End If

                            End If

                        End If

                    Next

                    BindPage()

                    If (lblWarning.Text = Null.NullString) Then
                        ManagePageState(PageState.View)
                    End If

                End If

            ElseIf (sender.Equals(lnkCancel)) Then

                ManagePageState(PageState.View)

            ElseIf (sender.Equals(lnkReturnToRaids)) Then

                tss_DKP_Parent.lnkReturnToRaids_Click()

            End If

        End Sub

#End Region

#Region "Public Methods"

        Public Sub Initialize(ByVal objRaid As tss_RaidInfo)

            vsRaidID = objRaid.RaidID
            ManagePageState(PageState.View)

        End Sub

#End Region

    End Class

End Namespace